<?php
require_once 'Core/Form/AbstractForm.php';

/**
 * This is the login form
 *
 */
class Core_OAuth_Form
	extends Core_Form_AbstractForm
{
	/**
	 * Initialization routine for this form.
	 */
	public function init()
	{
		parent::init();
		
		$this->setAttrib( 'id', 'oauth' );
		
		$token = new Core_Form_Element_Hidden ( 'oauth_token' );
		$token->setRequired( true );
		
		$callback = new Core_Form_Element_Hidden ( 'oauth_callback' );
		$callback->setRequired( true );
		$callback->setValue('oob');
		
		$accept = new Core_Form_Element_Hidden ( 'oauth_accept' );
		$accept->setRequired( true );
		$accept->setValue(1);
		$accept->addValidator( new Zend_Validate_Identical('1') );
		
		$submit = new Core_Form_Element_Submit ( 'submit' );
		$submit->removeDecorator('dl');
		$submit->setLabel ( 'form_oauth_element_submit_label' );
		$submit->setAttrib('class', 'submit');
		$submit->setRequired( true );
		$submit->setIgnore( true );
		
		// Add the elements to the forms
		$this->addElements ( array ( $token, $callback, $accept, $submit ) );
	}
}
